<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let n = parseInt(prompt('请输入行数'));
        let t = Math.floor(n/2);
        for(let i = 0;i < n;++i){
            for(let j = 0;j < n;++j){
                if(Math.abs(i-t)+Math.abs(j-t) <= t){
                    document.write('*');
                }else{
                    document.write('&nbsp')
                }
            }
            document.write('<br>');
        }
        for(let i = 0;i < n;++i){
            for(let j = 0;j <= i;++j){
                document.write('*');
            }
            document.write("<br>");
        }

    </script>
</body>
</html>